#ifndef BENCHMARK_H
#define BENCHMARK_H

#include <iostream>
#include <chrono>

namespace ParticleEngine
{
	class Benchmark
	{
		Benchmark() :
			DMin(std::chrono::hours(1))
		{}

		void Start()
		{
			T0 = Clock::now();
		}
		void Stop()
		{
			T1 = Clock::now();

			std::chrono::system_clock::duration D = T1 - T0;
			if (D < DMin)
			{
				DMin = D;
				std::cout << D.count << '\n';
			}

		}

		typedef std::chrono::high_resolution_clock Clock;
		std::chrono::system_clock::duration DMin;

		std::chrono::system_clock::time_point T0;
		std::chrono::system_clock::time_point T1;

	}
}

#endif